<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>layui.form小例子</title>
        <link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
    </head>
    <body>
        <form class="layui-form"> <!-- 提示：如果你不想用form，你可以换成div等任何一个普通元素 -->
            <div class="layui-form-item">
                <label class="layui-form-label">下拉选择框</label>
                <div class="layui-input-block">
                    <select name="goods_id" lay-filter="aihao">
                        <option value="0">请选择</option>
                    {volist name="data.collects" id="vo"}
                        <option value="{$vo.goods.id}">{$vo.goods.title}</option>
                    {/volist}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="*">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
            <!-- 更多表单结构排版请移步文档左侧【页面元素-表单】一项阅览 -->
        </form>
        <script src="/static/layui/layui.js"></script>
        <script>
            layui.use('form', function(){
              var form = layui.form;

              form.on('submit(*)', function(data){
                  // alert(JSON.stringify(data));return false;
                  // parent.goods_id = data.field.goods_id;
                  parent.getGoodsId(data.field.goods_id);
              })
              //各种基于事件的操作，下面会有进一步介绍
            });
        </script>
    </body>
</html>
